import { createRoot } from 'react-dom/client'
import './index.less'
import App from './App.jsx';
import { ConfigProvider } from 'antd';
import zhCN from 'antd/es/locale/zh_CN';
import { BrowserRouter, Routes, Route, Navigate,HashRouter } from 'react-router-dom'
import ProjectManage from './pages/project-manage/index.jsx'
import TestCase from './pages/test-case/index.jsx'
import FlowStep from './pages/base-config/flow-step/index.jsx'
import Hardware from './pages/base-config/hardware/index.jsx'
import Highway from './pages/base-config/highway/index.jsx'
import Observer from './pages/base-config/observer/index.jsx'
import Protocol from './pages/base-config/protocol/index.jsx'
import Share from './pages/base-config/share/index.jsx'
import TestCaseFlowDesigner from './pages/test-case/flow-designer/index.jsx'
import Branch from './pages/branch/index.jsx'
import BranchFlowDesigner from './pages/branch/flow-designer/index.jsx'


createRoot(document.getElementById('root')).render(
    <ConfigProvider componentSize="middle" locale={zhCN}>
        <HashRouter>
            <App>
                <Routes>
                    <Route path="/" element={<Navigate to="/project-manage"/>} />
                    <Route path="/project-manage" element={<ProjectManage />} />
                    <Route path="/test-case" element={<TestCase />} />
                    <Route path="/test-case-designer/:id" element={<TestCaseFlowDesigner />} />
                    <Route path="/branch" element={<Branch />} />
                    <Route path="/branch-designer/:id" element={<BranchFlowDesigner />} />
                    <Route path="/base-config" element={<Navigate to="/base-config/flow-step"/>} />
                    <Route path="/base-config/flow-step" element={<FlowStep />} />
                    <Route path="/base-config/hardware" element={<Hardware />} />
                    <Route path="/base-config/protocol" element={<Protocol />} />
                    <Route path="/base-config/observer" element={<Observer />} />
                    <Route path="/base-config/share" element={<Share />} />
                    <Route path="/base-config/highway" element={<Highway />} />
                </Routes>
            </App>
        </HashRouter>
    </ConfigProvider>
)